#ifndef _PODUCTION_H_
#define _PODUCTION_H_

#include <string>
#include "Consuption.h"

struct ProductionState{
	double dMoney;
	double dStateMoney;
	double dStorage;
	double dNp;
	double dCp;
	double dNi;
	double dCi;
	double dIb;
	double dIi;
	double dConsuption;	
	double dExportation;
	double dMaxStorageCapacity;
	double dMaxTotalProduction;	
	double dLastTurnConsuption;
	double dLastTurnMoney;
	double dLlastTurnGain;
	double dLastTurnTaxes;
};

class Production {

public:
	Production(void);

	int init(void);

	void release(void);	

	void update(void);

	std::string toString();

	int setNp(double NP);

	int setNi(double NI);

	int setCp(double CP);

	int setCi(double CI);

	int setIb(double IB);

	int setIi(double II);

	int setConsuption(double consuption);

	int setExportation(double exportation);

	int saveStateMoney(double m_stateMoney);

	double getConsuption() const;

	ProductionState getState() const;

	~Production(void);

private:
	bool m_bIsInitialized;
	struct ProductionState m_state;
	double m_dMoney;
	double m_dStateMoney;
	int m_iStorage;
	double m_dNp;
	double m_dCp;
	double m_dNi;
	double m_dCi;
	double m_dIb;
	double m_dIi;
	double m_dConsuption;
	Consuption* m_pConsuption;
	double m_dExportation;
	int m_iMaxStorageCapacity;
	double m_dMaxTotalProduction;
	
	double m_dLastTurnConsuption;
	double m_dLastTurnMoney;
	double m_dLlastTurnGain;
	double m_dLastTurnTaxes;

	void analyze(void);
	void increaseProduction(double dNp);
	void decreaseProduction(double dDecrease);
	int setMoney(double dMoney);
	int setStorage(int iStorage);
	int saveState();

};

#endif